<template>
	<view class="storeListWrapper">
		<view class="listWrapper">
			<view v-for="item in storelist" class="item" v-on:click="bindItem(item.Id)">
				<!-- <image mode="aspectFit" class="item-icon" :src="item.icon"></image> -->
				<view class="item-title">{{item.Name}}</view>
				<view class="item-phone">{{item.Phone}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import http from '../../common/http.js';
	export default {
		data() {
			return {
				storelist:[]
			}
		},
		onLoad() {
			this.getStoreList()
		},
		methods: {
			getStoreList() {
				var self = this
				http.get("/store/storelist", {}, (res)=>{
					console.log(res)
					self.storelist = res
				})
			},
			bindItem(storeid) {
				uni.redirectTo({
					url:"../store/store?storeid="+storeid
				})
			}
		}
	}
</script>

<style>
	page {
		background-color: #f6f6f6;
	}
	.listWrapper {
		padding: 0 15px;
		box-sizing: border-box;
	}
	.item {
		background-color: white;
		height: 50px;
		margin-top: 10px;
		border-radius: 10px;
		padding: 10px;
	}
	.item-title {
		font-size: 16px;
		font-weight: 300;
	}
	.item-icon {
		width: 50px;
		height: 50px;
		background-color: red;
		float: left;
		margin-right: 10px;
		border-radius: 25px;
	}
	.item-phone {
		color: #999999;
	}
</style>
